-- Creator:       MySQL Workbench 5.2.40/ExportSQLite plugin 2009.12.02
-- Author:        Andy
-- Caption:       New Model
-- Project:       Name of the project
-- Changed:       2012-06-08 20:52
-- Created:       2012-06-01 18:43
PRAGMA foreign_keys = OFF;

-- Schema: rpgsoundmixer
BEGIN;
CREATE TABLE "track"(
  "idtrack" VARCHAR(36) PRIMARY KEY NOT NULL,
  "path" VARCHAR(450),
  "name" VARCHAR(450)
);
CREATE TABLE "category"(
  "idcategory" VARCHAR(36) PRIMARY KEY NOT NULL,
  "name" VARCHAR(45)
);
CREATE TABLE "trackInCategorie"(
  "ID" INTEGER PRIMARY KEY NOT NULL,
  "trackId" VARCHAR(45),
  "categoryId" VARCHAR(45),
  CONSTRAINT "categoryId"
    FOREIGN KEY("categoryId")
    REFERENCES "category"("idcategory"),
  CONSTRAINT "trackId"
    FOREIGN KEY("trackId")
    REFERENCES "track"("idtrack")
);
CREATE INDEX "trackInCategorie.categoryId" ON "trackInCategorie"("categoryId");
CREATE INDEX "trackInCategorie.trackId" ON "trackInCategorie"("trackId");
CREATE TABLE "SoundSuite"(
  "idSoundSuite" VARCHAR(50) PRIMARY KEY NOT NULL,
  "Name" VARCHAR(45),
  "Abenteuer" VARCHAR(45)
);
CREATE TABLE "effektGroup"(
  "ideffektGroup" VARCHAR(36) PRIMARY KEY NOT NULL,
  "name" VARCHAR(45),
  "key" CHAR,
  "SoundSuite" VARCHAR(50),
  CONSTRAINT "SoundSuite"
    FOREIGN KEY("SoundSuite")
    REFERENCES "SoundSuite"("idSoundSuite")
);
CREATE INDEX "effektGroup.SoundSuite" ON "effektGroup"("SoundSuite");
CREATE TABLE "effekt"(
  "ideffekt" VARCHAR(36) PRIMARY KEY NOT NULL,
  "effektName" VARCHAR(45),
  "key" CHAR,
  "effektArt" INTEGER,
  "volume" INTEGER,
  "effektGroup" VARCHAR(45),
  CONSTRAINT "groupId"
    FOREIGN KEY("effektGroup")
    REFERENCES "effektGroup"("ideffektGroup")
);
CREATE INDEX "effekt.groupId" ON "effekt"("effektGroup");
CREATE TABLE "trackInEffekt"(
  "idtrackInEffekt" INTEGER PRIMARY KEY NOT NULL,
  "trackId" VARCHAR(45),
  "effektId" VARCHAR(45),
  CONSTRAINT "trackId"
    FOREIGN KEY("trackId")
    REFERENCES "track"("idtrack"),
  CONSTRAINT "effektId"
    FOREIGN KEY("effektId")
    REFERENCES "effekt"("ideffekt")
);
CREATE INDEX "trackInEffekt.trackId" ON "trackInEffekt"("trackId");
CREATE INDEX "trackInEffekt.effektId" ON "trackInEffekt"("effektId");
COMMIT;
